Skip to content

fix: UI scaling and content cropping#21

Open
mite404 wants to merge 1 commit intolcoutodemos:mainfrom
mite404:fix-ui-scaling-cropping
Open

fix: UI scaling and content cropping#21
mite404 wants to merge 1 commit intolcoutodemos:mainfrom
mite404:fix-ui-scaling-cropping

Conversation

@mite404
Copy link
Copy Markdown

@mite404 mite404 commented Mar 19, 2026

Intercepts Cmd+=/Cmd+-/Cmd+0 via before-input-event before Chromium sees them, so the main process fully owns zoom. Using zoom-changed was unreliable — Chromium applies its own preset step on top, causing the actual zoom factor to exceed what the window was sized for and clipping content. The top of the chat window and the left btns were cropped at higher zoom levels. This was particularly evident with 'Full width' toggled on.

Screenshot 2026-03-19 at 1 40 46 PM

Changes:

  • Added applyZoom(zoom) — resizes and repositions the window proportionally to the zoom factor, clamping the left edge to the screen boundary to prevent macOS from clipping panel windows that start off-screen

  • Updated showWindow() to read the current zoom factor and apply it when repositioning, so the window doesn't snap back to 1× on summon

  • Bumped BAR_WIDTH from 1040 → 1100 to give the renderer more horizontal breathing room at default zoom

  • Added .zed to `.gitignore so I could turn off 'format on save' and 'remove trailing whitespace' for this project else too many lines were changed

Intercepts `Cmd+=`/`Cmd+-`/`Cmd+0` via `before-input-event` before Chromium sees them, so the main
process fully owns zoom. Using `zoom-changed` was unreliable — Chromium applies its own preset step
on top, causing the actual zoom factor to exceed what the window was sized for and clipping content.
The top of the chat window and the left btns were cropped at higher zoom levels. This was
particularly evident with 'Full width' toggled on.

**Changes:**
- Added `applyZoom(zoom)` — resizes and repositions the window proportionally to the zoom factor,
  clamping the left edge to the screen boundary to prevent macOS from clipping panel windows that
  start off-screen

- Updated `showWindow()` to read the current zoom factor and apply it when repositioning, so the
  window doesn't snap back to 1× on summon

- Bumped `BAR_WIDTH` from 1040 → 1100 to give the renderer more horizontal breathing room at default
  zoom

- Added `.zed` to `.gitignore so I could turn off 'format on save' and 'remove trailing whitespace'
  for this project else too many lines were changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant